<div class="ibox">
 <div class="ibox-content">
<form class="form-horizontal"  id="editForm" action="${cxt!}/platform/menu/update" method="POST" >

		   <input type="hidden" id="menuid" name="menu.id" value="${menu.id!}" >
			
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.menuName"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="menu.name" placeholder="${_res['systemManage.menuName']}" value="${menu.name!}" required aria-required="true">
	             </div>
	             
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.menuNameen"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="menu.nameen" placeholder="${_res['systemManage.menuNameen']}" value="${menu.nameen!}" required aria-required="true">
	             </div>
           </div>
           <div class="hr-line-dashed"></div>
 
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["systemManage.menuSup"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
	              	<input type="text" class="form-control" name="parentMenuName" id="partentMenuName" value="${menu.parentMenu.name!}"  placeholder="${_res['systemManage.menuSelect']}" data-toggle="modal" data-target="#myModal">
                	<!-- 父菜单id，从modal中获取 -->
	             	<input type="hidden" name="menu.parentid"  id="parentMenuId" value="${menu.parentid!}" required aria-required="true"/>
                </div>		             

	             <label for="namebasic" class="col-md-2 control-label">URL</label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="menu.url" placeholder="URL" value="${menu.url!}" >
	             </div>	
           </div>
           <div class="hr-line-dashed"></div>    
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["systemManage.menuSystem"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict  class="form-control"  type="select"  value="${menu.systemid!}" name="menu.systemid"  dictCode="SYSTEM_CODE"  required="true"/>
                </div>	
                      
                <label class="col-sm-2 control-label">${_res["systemManage.menuStatus"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict type="select" class="form-control" name="menu.status"  dictCode="COMMON_STATUS"  value="${menu.status!}" required="true"/>
                </div>	                       	             
           </div>    
           <div class="hr-line-dashed"></div>           
 
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["system.priority"]}</label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="menu.priority"  value="${menu.priority!}" >
	             </div>	             
           </div>
           <div class="hr-line-dashed"></div>
           
            <div class="form-group">
              <div class="col-md-10 col-md-offset-2">
                <button type="button" class="btn btn-warning" onClick="ajaxContent('/platform/menu/list');">${_res["system.return"]}</button>
                <button type="submit" class="btn btn-primary" >${_res["system.confirm"]}</button>
                <button type="button" class="btn btn-danger" onClick="ajaxContent('/platform/menu/list');">${_res["system.cancel"]}</button>
              </div>
            </div>
</form>
</div></div>

<#submit  formId="editForm"  divId="content" />

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModaLabel">
	<%include("selectPartentNode.html"){}%>
</div>
<#nav />

<script>
$(document).ready(function(){
	//增加模拟框拖动效果
	$(".modal").draggable({
	    handle: ".modal-header"
	});
	
	initParentMenu();
});

/*初始化父菜单值  当为根菜单时显示根菜单  */
function initParentMenu(){
	var parentMenuId = $("#parentMenuId").val();
	if(0==parentMenuId){
		$("#partentMenuName").val("${_res['system.rootMenu']}");
	}
}

</script>